<?php
$scriptWindowMsg = "
    $(function() {
        $('a#close').click(function() {
            window.close();
        });
    });";
$this->Html->scriptBlock($scriptWindowMsg, array('inline' => false));
?>
<?php ob_start(); ?>
<style>
    .title-body-content {
        color: #A0002A;
        font-size: 17px;
        font-weight: bold;
        height: auto;
        margin: 0 0 0;
        padding: 0;
        text-align: center;
        width: 100%;
    }
    .clearfix:after {
        clear: both;
        content: ".";
        display: block;
        font-size: 0;
        height: 0;
        visibility: hidden;
    }
    .wrapper-content-body {
        background-color: White;
        height: auto;
        margin: 0 0 60px;
        padding: 0 16px 0;
        width: 96.8%;
    }
    .wrapper-form-account-resume {
        height: auto;
        margin: 20px 60px 0;
        text-align: left;
        width: auto;
    }
    .wrapper-insurance-type-page4 {
        margin: 3px 0 0;
    }
    .clearfix {
        display: block;
    }
    .wrapper-rein-page4 {
        margin: 3px 0 0;
    }
    .wrapper-insurance-type-page4 {
        margin: 3px 0 0;
    }
    .wrapper-ori-insurer-page4 {
        margin: 3px 0 0;
    }
    .wrapper-rate-page4 {
        margin: 3px 0 0;
    }
    .wrapper-gross-pre-page4 {
        margin: 3px 0 0;
    }
    .wrapper-rate-page4 {
        margin: 3px 0 0;
    }
    .wrapper-gross-pre-page4 {
        margin: 3px 0 0;
    }
    .wrapper-gross-pre-page4 {
        margin: 3px 0 0;
    }
    .wrapper-payment-schedule {
        height: auto;
        margin: 20px 0 0;
        width: auto;
    }
    .size-span {
        display: inline-block;
        vertical-align: top;
        width: 135px;
    }
    .tbl-payment {
        height: auto;
        margin: 20px 0;
        table-layout: fixed;
        width: 98.6%;
    }
    .wrapper-payment-schedule {
        height: auto;
        margin: 20px 0 0;
        width: auto;
    }
    .wrapper-content-payment-schedule {
        height: auto;
        width: auto;
    }
    .tbl-payment tr {
        height: auto;
        padding: 5px;
    }
    .tbl-payment-title {
        font-weight: bold;
    }
    .tbl-payment tr td {
        height: auto;
        padding: 5px;
    }
    pre{
        border-spacing: 0;
        color: black;
        font-family: Arial,Helvetica,sans-serif;
        font-size: 12px;
        line-height: 20px;
        word-spacing: 0;
    }
</style>
<div class="header clearfix">
    <div class="head-logo">
        <?php echo $this->Html->image('/img/aih/ARBL FULL Logo Letterhead Footer JPG r.jpg'); ?>
    </div>
    <!-- HTML for menu-bottom-header-->
</div>
<!-- HTML-Body-Web-->
<div class="wrapper-body clearfix">
    <div class="wrapper-content-body clearfix">
        <div class="title-body-content"><?php echo $title_for_layout; ?></div>
        <div class="wrapper-table clearfix">
            <?php
            echo '<div>
            <div>Date: ' . date('d M Y', strtotime($aihexpenses['Aihexpense']['date'])) . '</div>
            <div style="padding-top: 20px;">
                <div style="font-weight: bold;">Maybank International</div>
                <div>Level 16 (B), Main Office Tower </div>
                <div>Financial Park Labuan </div>
                <div>Jln Merdeka </div>
                <div>87000 F. T. Labuan </div>
            </div>
            <div style="padding-top: 20px; font-weight: bold; text-decoration: underline;">Attention: Treasury Processing Executives </div>
            <div style="padding-top: 20px;">Dear Sir/Mdm,</div>
            <div style="padding-top: 20px; font-weight: bold;">RE: ' . $aihexpenses['Aihexpense']['refid_edit'] . '</div>
        </div>
        <div style="padding-top: 20px;">    
        This is to authorize you to debit our account for the amount ' . $aihexpenses['Aihexpense']['amount_note'] . ' (' . $aihexpenses['Aihexpense']['amount'] . ' ' . $aihexpenses['Aihexpense']['currency'] . ') 
        and transfer as follows: -
        </div>
        <div>
            <table class="tbl-broking" border="1" style="width:650px;">
                <tr>
                    <td width="50px" style="font-weight: bold;">1</td>
                    <td width="200px" style="font-weight: bold; text-align: left; padding-left: 5px;">For Credit To:</td>
                    <td width="400px" style="text-align: left; padding-left: 5px;"><pre>' . $aihexpenses['Aihexpense']['to'] . '</pre></td>
                </tr>
                <tr>
                    <td style="font-weight: bold;">2</td>
                    <td style="font-weight: bold; text-align: left; padding-left: 5px;">In Favour Of::</td>
                    <td style="text-align: left; padding-left: 5px;"><pre>' . $aihexpenses['Aihexpense']['from'] . '</pre></td>
                </tr>
                <tr>
                    <td style="font-weight: bold;">3</td>
                    <td style="font-weight: bold; text-align: left; padding-left: 5px;">Value Date:</td>
                    <td style="text-align: left; padding-left: 5px;">' . date('d M Y', strtotime($aihexpenses['Aihexpense']['date'])) . '</td>
                </tr>
                <tr>
                    <td style="font-weight: bold;">4</td>
                    <td style="font-weight: bold; text-align: left; padding-left: 5px;">Charges if any should be borne by:</td>
                    <td style="text-align: left; padding-left: 5px;">' . $aihexpenses['Aihexpense']['charge_name'] . '</td>
                </tr>
                <tr>
                    <td style="font-weight: bold;">5</td>
                    <td style="font-weight: bold; text-align: left; padding-left: 5px;">Purpose of payment:</td>
                    <td style="text-align: left; padding-left: 5px;">' . $aihexpenses['Aihexpense']['description'] . '</td>
                </tr>
            </table>
        </div>
        <div style="padding-top: 20px;">Thank you in advance for your kind assistance and we look forward to receive your confirmation in due course.</div>
        <div style="padding-top: 20px;">
        Authorized signatory <br />
        Michael Charles Darby <br />
        Director <br />
        </div>
        ';
            ?>
            <?php
            $HtmlCode = ob_get_contents();
            ob_end_flush();
            $file = '/home/johnso28/public_html/aihreinsurance.com/dompdf/aih/aihexpense_report.html';
            $HtmlCode1 = str_replace('/aih/img/aih/ARBL FULL Logo Letterhead Footer JPG r.jpg', 'img/ARBL FULL Logo Letterhead Footer JPG r.jpg', $HtmlCode);
            file_put_contents($file, $HtmlCode1);
            ?>
            <div class="wrapper-button-form clearfix">
                <div class="button-form clearfix">
                    <a href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/dompdf/dompdf.php?base_path=aih/&input_file=aihexpense_report.html&paper=a4">Download PDF</a>
                </div>
            </div>
            <div class="wrapper-button-form clearfix">
                <div class="button-form clearfix">
                    <div class="button-aihre button-blue"><a href="JavaScript:void(0)" title="CLOSE" id="close"><?php echo __('CLOSE'); ?></a></div>
                </div>
            </div>
        </div>
    </div>
</div>